﻿using System;
using System.Collections;
using AUIP.Scripts.City.GameLogic;
using Gp.Scripts.Core;
using Gp.Scripts.Core.Command;
using Gp.Scripts.Data;
using Gp.Scripts.GUI;
using PixelCrushers.DialogueSystem;
using QFramework;
using UnityEngine;
using GUIManager = Gp.Scripts.Core.GUIManager;
using IAction = GameCreator.Core.IAction;

namespace Gp.GCX {
    [AddComponentMenu("")]
    public class BattleStartAc : IAction {
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index) {
            // DialogueManager.StopConversation();
            Global.Get<BattleSystem>().StartBattle();
            
            // yield return new WaitForSeconds(0.1f);
            yield return true;
        }


#if UNITY_EDITOR
        public new static string NAME = "Gp/开启战斗";
        private const string NODE_TITLE = "开启战斗";

        public override string GetNodeTitle() {
            return string.Format(NODE_TITLE);
        }

#endif
    }
}